package com.yqg.protection.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.protection.cover.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * warn_record 实体类
 *
 * @author zxf
 * @since 2024-01-01
 */
@Getter
@Setter
@TableName("warn_record")
@ApiModel(value = "WarnRecord对象", description = "")
public class WarnRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "ID",index = 0)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "设备ID",index = 1)
    @ApiModelProperty("设施连接设备")
    private Long equipmentInputStoreId;

    @ExcelProperty(value = "部件编号",index = 2)
    private String partModel;

    @ExcelProperty(value = "部件名称",index = 3)
    @TableField(exist = false)
    private String partName;

    @ExcelProperty(value = "报警类型编号",index = 4)
    private Integer warnTypeNum;

    @ExcelProperty(value = "报警类型名称",index = 5)
    @TableField(exist = false)
    private String warnTypeName;

    @ExcelProperty(value = "报警状态编号",index = 6)
    private String warnStateNum;

    @ExcelProperty(value = "报警状态名称",index = 7)
    @TableField(exist = false)
    private String warnStateName;

    @ExcelProperty(value = "是否误报",index = 8, converter = IsMisinformationConverter.class)
    private String isMisinformation;

    @ExcelProperty(value = "是否处理",index = 9, converter = IsDealConverter.class)
    private Integer isDeal;

    @ExcelProperty(value = "创建时间",index = 10, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ExcelProperty(value = "报警时间",index = 11)
    private String warnTime;

    @ExcelProperty(value = "报警地点",index = 12)
    private String warnAddr;

    @ExcelProperty(value = "报警说明",index = 13)
    private String warnExpl;

    @ExcelProperty(value = "处理时间",index = 14, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime processingTime;

    @ApiModelProperty("0,正常 1，删除")
    @ExcelIgnore
    private Integer isDelete;

    @ExcelProperty(value = "消息通知",index = 15, converter = TeleNotificationConverter.class)
    @ApiModelProperty("消息通知：0 未通知，1 已通知")
    private String teleNotification;

    @ExcelProperty(value = "故障上报",index = 16, converter = FaultReportConverter.class)
    @ApiModelProperty("故障上报：0 未上报，1 已上报")
    private String faultReport;

    @ExcelProperty(value = "故障上报备注",index = 17)
    @ApiModelProperty("故障上报备注")
    private String faultReportExpl;

    @ExcelProperty(value = "故障上报图片",index = 18)
    @ApiModelProperty("故障上报图片")
    private String faultReportUrl;

    @ExcelProperty(value = "实地勘查",index = 19, converter = FieldSurveyConverter.class)
    @ApiModelProperty("实地勘查：0 未勘查，1 已勘查")
    private String fieldSurvey;

    @ExcelProperty(value = "实地勘查备注",index = 20)
    @ApiModelProperty("实地勘查备注")
    private String fieldSurveyExpl;

    @ExcelProperty(value = "实地勘查图片",index = 21)
    @ApiModelProperty("实地勘查图片")
    private String fieldSurveyUrl;

    @ExcelProperty(value = "排除隐患",index = 22, converter = EliminHidDangConverter.class)
    @ApiModelProperty("排除隐患：0 未排除，1 已排除")
    private String eliminHidDang;

    @ExcelProperty(value = "排除隐患备注",index = 23)
    @ApiModelProperty("排除隐患备注")
    private String eliminHidDangExpl;

    @ExcelProperty(value = "排除隐患图片",index = 24)
    @ApiModelProperty("排除隐患图片")
    private String eliminHidDangUrl;

    @ExcelProperty(value = "单位名称",index = 25)
    @TableField(exist = false)
    private String clientName;

    @ExcelProperty(value = "设备ID",index = 26)
    @TableField(exist = false)
    private String equipmentId;

    @ExcelProperty(value = "设备名称",index = 27)
    @TableField(exist = false)
    private String equipmentName;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer equipmentType;

}
